<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../layer/layer.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form action="#" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">姓名</td>
        <td id="d_name">程俊</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">证件号</td>
        <td id="d_idCar">534534534</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">手机</td>
        <td id="d_phone">13124345432</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">座机</td>
        <td id="d_telPhone">01068765432</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">性别</td>
        <td id="d_sex">男</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">年龄</td>
        <td id="d_age">28</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">出生年月</td>
        <td id="d_birthday">1981-09-04</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">电子邮箱</td>
        <td id="d_email">chengjun@msn.com.cn</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">所属科室</td>
        <td id="d_keshi">急诊科</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">学历</td>
        <td id="d_xueli">本科</td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td id="d_desc">工作热情积极表现非常的优异</td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button type="button" class="btn btn-success" name="backid" id="backId">返回列表</button>
			</center>
		</td>
    </tr>
</table>
</form>
</body>
</html>
<script type="text/javascript">
    String.prototype.GetValue= function(para) {
        let reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)");
        let r = this.substr(this.indexOf("\?")+1).match(reg);
        if (r!=null) return unescape(r[2]); return null;
    }
    $(function () {
        //根据地址获取teamId,如果null则执行增加，否则执行更新
        let url = document.location.toString();//获取URL
        let d_id = url.GetValue("d_id");
        let pageNum = url.GetValue("pageNum");
        load(d_id);
        $('#backId').click(function(){
            window.location.href="index.html?pageNum="+pageNum;
        });
    });

    function load(d_id){
        let windowId = layer.load();
        $.ajax({
            type: "GET",
            url: "/doctor/queryById/"+d_id, //RESTful风格的API定义
            data: "",
            dataType:"json",
            success: function (vo) {
                layer.close(windowId);
                if (vo.code == 200){
                    let obj=vo.obj;
                    let d_id=obj.d_id;
                    let d_name=obj.d_name==null?'数据丢失':obj.d_name;
                    let d_idCar=obj.d_idCar==null?'数据丢失':obj.d_idCar;
                    let d_telPhone=obj.d_telPhone==null?'数据丢失':obj.d_telPhone;
                    let d_birthday=obj.d_birthday==null?'数据丢失':obj.d_birthday;
                    let d_phone=obj.d_phone==null?'数据丢失':obj.d_phone;
                    let d_email=obj.d_email==null?'数据丢失':obj.d_email;
                    let d_sex=obj.d_sex=='0'?'女':'男';
                    let d_age=obj.d_age;
                    let d_keshi=obj.d_keshi==null?'数据丢失':obj.d_keshi;
                    let d_xueli=obj.d_xueli==null?'数据丢失':obj.d_xueli;
                    let d_desc=obj.d_desc==null?'数据丢失':obj.d_desc;
                    $("#d_name").html(d_name);
                    $("#d_idCar").html(d_idCar);
                    $("#d_phone").html(d_phone);
                    $("#d_telPhone").html(d_telPhone);
                    $("#d_sex").html(d_sex);
                    $("#d_age").html(d_age);
                    $("#d_birthday").html(d_birthday);
                    $("#d_email").html(d_email);
                    $("#d_keshi").html(d_keshi);
                    $("#d_xueli").html(d_xueli);
                    $("#d_desc").html(d_desc);
                }else {
                    layer.msg(vo.msg);
                }
            }
        });
    }
</script>